﻿@using VietTrips.WebUI.Helpers
@model PagedList.IPagedList<VietTrips.WebUI.Areas.Management.Models.TourAgencyViewModel>
@* Model của page này là 1 object kiểu IPagedList<UserProfile> nó giống như List nhưng hỗ trợ Paging *@

@{
    var currentUsername = User != null ? User.Identity.Name : "unknown";
    int pageNumber = PageNumberHelper.ConvertObjectToInt(ViewBag.Page, 1); // store page number
    int rowsNumber = PageNumberHelper.ConvertObjectToInt(ViewBag.RowsPerPage, 10); // store page size => "maximum records per page"
    int totalUsers = PageNumberHelper.ConvertObjectToInt(ViewBag.UsersCount, 0); // store number of total records
    int rowCount = Model != null ? Model.Count() : 0;                                               // store number of records that will be shown
    NavCurrentHelper.Menu = 2;                                                  // Store the navigation side bar state
    NavCurrentHelper.Submenu = 1;                                               // Store the navigation side bar state
    ViewBag.Title = "Danh Sách Công Ty";
    Layout = "~/Areas/Management/Views/Shared/_AdminLayout.cshtml";
}

@section styles {
    <!-- BEGIN PAGE LEVEL STYLES -->
    <link rel="stylesheet" type="text/css" href="~/Content/metronic/plugins/select2/select2.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/metronic/plugins/select2/select2-metronic.css" />
    <link rel="stylesheet" href="~/Content/metronic/plugins/data-tables/DT_bootstrap.css" />
    <!-- END PAGE LEVEL STYLES -->
}

@section featured {
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <h3 class="page-title">
                @ViewBag.Title
            </h3>
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="@Url.Action("Dashboard", "Admin")">
                        Trang Quản Lý
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">
                        @ViewBag.Title
                    </a>
                </li>
                <li class="pull-right">
                    <div id="dashboard-report-range" class="dashboard-date-range tooltips" data-placement="top" data-original-title="Change dashboard date range">
                        <i class="fa fa-calendar"></i>
                        <span>
                        </span>
                        <i class="fa fa-angle-down"></i>
                    </div>
                </li>
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->
        </div>
    </div>
}


<!-- BODY PART -->


@section scripts {
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script type="text/javascript" src="~/Content/metronic/plugins/select2/select2.min.js"></script>
    <script type="text/javascript" src="~/Content/metronic/plugins/data-tables/jquery.dataTables.js"></script>
    <script src="~/Content/metronic/scripts/core/datatable.js"></script>
    @*<script type="text/javascript" src="~/Content/metronic/plugins/data-tables/DT_bootstrap.js"></script>*@
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="~/Content/metronic/scripts/custom/table-managed.js"></script>
    <script>
        jQuery(document).ready(function () {
            //Handle the Group-Checkbox button
            jQuery('#sample_1 .group-checkable').change(function () {
                var set = jQuery(this).attr("data-set");
                var checked = jQuery(this).is(":checked");
                jQuery(set).each(function () {
                    if (checked) {
                        $(this).attr("checked", true);
                        $(this).parents('tr').addClass("active");
                        $(this).parents('span').addClass("checked");
                    } else {
                        $(this).attr("checked", false);
                        $(this).parents('tr').removeClass("active");
                        $(this).parents('span').removeClass("checked");
                    }
                });
                jQuery.uniform.update(set);
                $('#sample_1 .group-checkable').parents('span').toggleClass("checked");
            });

            // Handle checkbox button for every Checkbox respectively
            jQuery('#sample_1').on('change', 'tbody tr .checkboxes', function () {
                var checked = jQuery(this).is(":checked");
                if (checked) {
                    $(this).attr("checked", true);
                } else {
                    $(this).attr("checked", false);
                }
                $(this).parents('tr').toggleClass("active");
                $(this).parents('span').toggleClass("checked");
            });
        });
    </script>
}